<template>
	<view class="wrap">
		<view class="">
			<!-- 2.0.19支持autoBack，默认为false -->
			<u-navbar leftText="绑定手机号" :autoBack="true">
			</u-navbar>
		</view>
		<view class="top"></view>
		<view class="content">
			<view class="title" style="height: 100rpx;"></view>
			<input class="u-border-bottom" type="number" v-model="tel" placeholder="请输入手机号" />
			<view class="tips">请输入要绑定的手机号</view>
			<u-button :customStyle="btnStyle" @click="login">下一步</u-button>
		</view>
		<u-toast ref="uToast" />
		<view class="buttom">
			<view class="hint"  style="font-size: 24rpx;">
				绑定手机号代表同意
				<text class="link">龙海智慧物业用户协议、隐私政策</text>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		send
	} from '@/service/smsService.js';

	export default {
		data() {
			return {
				tel: '',
				url: '',
				btnStyle: {
					width: '100%',
					height: '80rpx',
					borderRadius: '60rpx',
					backgroundImage: "url('https://resourse.cnlhjt.com/upload/20220825/d1aa35c1d129137d9b12c8f34e59c5bc.png')",
					backgroundSize: '100% 80rpx',
					fontSize: '34rpx',
					color: '#FFFFFF'
				},
			};
		},
		onLoad() {

		},
		methods: {
			login() {
				send({
					mobile: this.tel,
					type: 'check'
				}).then(res => {
					// console.log(res);
					if (res.code == 200) {
						this.$u.route({
							url: '/pages/index/code',
							params: {
								mobile: this.tel,
								requestId: res.result.RequestId
							}
						});
					} else {
						uni.showToast({
							title: res.msg,
							icon: 'error'
						});
					}
				});
			},
		}
	};
</script>

<style lang="scss" scoped>
	.wrap {
		font-size: 28rpx;
		height: 100%;
		overflow-y: hidden;

		.content {
			width: 600rpx;
			margin: 80rpx auto 0;

			.title {
				text-align: left;
				font-size: 60rpx;
				font-weight: 500;
				margin-bottom: 100rpx;
			}

			input {
				text-align: left;
				margin-bottom: 10rpx;
				padding-bottom: 6rpx;
			}

			.tips {
				color: #666666;
				margin-bottom: 60rpx;
				margin-top: 8rpx;
			}

			.getCaptcha {
				background-color: rgb(253, 243, 208);
				color: #666666;
				border: none;
				font-size: 30rpx;
				padding: 12rpx 0;

				&::after {
					border: none;
				}
			}

			.alternative {
				color: #666666;
				display: flex;
				justify-content: space-between;
				margin-top: 30rpx;
			}
		}

		.buttom {
			.loginType {
				display: flex;
				padding: 200rpx 150rpx 150rpx 150rpx;
				justify-content: space-between;

				.item {
					display: flex;
					flex-direction: column;
					align-items: center;
					color: #666666;
					font-size: 28rpx;
				}
			}

			.hint {
				position: fixed;
				bottom: 80rpx;
				padding: 20rpx 40rpx;
				font-size: 20rpx;
				color: #585858;

				.link {
					color: #53C21D;
				}
			}
		}
	}
</style>
